package com.example.tch.case03_16110100521;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {
    private Button btn;
    private EditText uname,pword;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn = findViewById(R.id.button);
        uname = findViewById(R.id.editText);
        pword = findViewById(R.id.editText2);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View View) {
                Intent intent = new Intent(MainActivity.this,WeloomeActivity.class);
                intent.putExtra("username",uname.getText().toString());
                intent.putExtra("password",pword.getText().toString());
                startActivity(intent);
            }
        });
    }
}
